package utils;

/**
 * Regex
 *
 * @author <a href="mailto:shuyaochen@sina.com">陈树钥</a>
 * @version 1.0
 * @since 2012-1-4 12:56:05
 */
public enum Regex {

    specialPhone("^(13800)[0-9]{6}$", ""),
    cellphone("^(13|14|15|18)[0-9]{9}$", ""),
    ip("^(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)$", ""),
    email("^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", ""),
    name("^[a-zA-Z0-9\\-_.\u4e00-\u9fa5]+$", "只能含有汉字、数字、字母、下划线、减号、点号"),
    nameAdditional("^\\d+$", ""),//，且不能纯数字
    zipCode("^\\d{6}$", "邮编要求格式是6位数字"),
    telephone("^(([0\\+]\\d{2,3}-)?(0\\d{2,3})-)?(\\d{7,8})(-(\\d{3,}))?$", "电话号码要求格式如：020-1234567"),////电话号码的函数(包括验证国内区号,国际区号,分机号)
    qq("[1-9][0-9]{4,14}",""),
    oldIdCard("^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$",""),//15位身份证
    newIdCard("^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9]|X)$","");//18位身份证
    public final String value;
    public final String tip;

    /**
     *
     * @param regex
     */
    Regex(String regex, String tip) {
        this.value = regex;
        this.tip = tip;
    }
}
